Loyola College B.Sc. Statistics April 2007 C And C ++ Question Paper PDF Download

                LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034

B.Sc. DEGREE EXAMINATION – STATISTICS

AC 21

 

FIFTH SEMESTER – APRIL 2007

ST 5401 – C AND C ++

 

 

 

Date & Time: 04/05/2007 / 1:00 – 4:00 Dept. No.                                              Max. : 100 Marks

 

 

PART A

Answer all the questions.                                                                        10 X 2 = 20

 

  1. Explain briefly “ scanf” and “printf” with an illustration.
  2. Write a program to output the following multiplication table.

5 X 1 = 5

5 X 2 = 10

……….

……….

5 X 10 = 50

  1. Explain decrement operator with an example.
  2. Write a program to convert the Fahrenheit to Celsius the following conversion formula: C = (F-32)/ 1.8.
  3. Identify syntax errors in the following program. After correcting, what output would you expect when you execute it?

Main ()

{

int r,c;

float perimeter: area,

c=3.1415;

r=5;

perimeter = 2.0 c*r;

area= c*r*r;

printf(“%f”,”%d”,&perimeter, &area)

}

  1. Mention any one salient feature of C++ when compared to C.
  2. What is the output of the following program?

main ()

{

int a = 2, n=100;

while(a<n)

{

cout<<a<<endl;

a=a*a;

}

}

  1. Write a program to find the largest number of the two numbers in C++.
  2. What is function in C++? And give an example for function.

 

 

 

 

 

  1. What is the output, corresponding to the following segment?

a=10;

b=15;

x=(a>b)?a:b;

cout<<x;

 

PART B

Answer any five questions.                                                               5 X 8 = 40

 

  1. Explain different types of constants in c programming.
  2. The traveling time by train from one city to another city is given in terms of minutes (eg. 280 minutes). Write a c program that reads the given value, converts it into hours: minutes format and display the same.
  3. When the principal, rate of interest and period of deposit are given, write a c program to compute the simple interest and compound interest using function.
  4. There are three categories (A, B, C) of employees in a company. They are charged 30%, 20% and 15% respectively of their salaries as income tax. Write a c program to find the income tax to be paid by him.
  5. The commission on a representative’s sales is calculated as follows:

a). if sales<Rs. 500, then there is no commission.

b). if Rs. 500 < sales < Rs. 5000, then commission = 10% of sales.

c). if sales > Rs. 5000, then commission = 5000 + 8% of sales .

Write a C++ program which reads in total sales and calculates commission.

  1. Write a C++ program to calculate perimeter with help of function overloading using the following conditions.

a). when two sides are equal then perimeter = 2(a+(a2 – h2)) units.

b). when three sides are known but not equal perimeter = a + b +c

  1. Write a C++ program to calculate addition of two matrices with the order of 4X4.
  2. Develop a function in C++  and calculate the factorial value of an integer n. Using this in the main () function to compute  ncr.

PART C

Answer any two questions.                                                               2 X 20 = 40

 

  1. a). Explain switch statement in C and give an example with the same.(5+5)

b). Write a C program to calculate mean and variance for N values with help of

array.                                                                                                         (10)

  1. a). Explain nested if statement with suitable example.                                   (5+5)
  2. b). Explain one and two-dimensional arrays with examples.                          (5+5)

 

  1. a). Explain function overloading.                                                                   (5)

b). Write a C++ program with help of function overloading to find out the largest number among two and three numbers.                                                             (15)

Go To Main page

 

 

 

 

 

Latest Govt Job & Exam Updates:

View Full List ...

© Copyright Entrance India - Engineering and Medical Entrance Exams in India | Website Maintained by Firewall Firm - IT Monteur